<div class="pagination">
    <span class="step-links">
        {% if dataset.has_previous %}
            <a class="pagelink" href="/ajax/datafile_list/{{dataset_id}}/?page={{ dataset.previous_page_number }}{% if filename_search %}&filename={{filename_search}}{% endif %}">Previous</a>
        {% endif %}
		
		{% for pagenum in dataset.paginator.page_range %}
				<a class="pagelink" href="/ajax/datafile_list/{{dataset_id}}/?page={{pagenum}}{% if filename_search %}&filename={{filename_search}}{% endif %}">{{pagenum}}</a>
		{% endfor %}

        {% if dataset.has_next %}
            <a class="pagelink" href="/ajax/datafile_list/{{dataset_id}}/?page={{ dataset.next_page_number }}{% if filename_search %}&filename={{filename_search}}{% endif %}">Next</a>
        {% endif %}

		<br/>
        <span class="current">
            Page {{ dataset.number }} of {{ dataset.paginator.num_pages }}.
        </span>
    </span>
</div>
<br/>
<div style="margin-left: 15px">
<input class="dataset_id" type="hidden" value="{{dataset_id}}">
Filename filter: <input type="text" onKeyPress="return disableEnterKey(event)" class="filename_search" name="filename" value="{% if filename_search %}{{filename_search}}{% endif %}">
</div>
<br/>
{% if mytardis_id %}
Select: <a class="dataset_selector_all">[All]</a> / <a class="dataset_selector_none">[None]</a>
<br/><br/>
	{% for datafile in dataset.object_list %}
	<li class="datafile">
		<input type="checkbox" class="datafile_checkbox" name="datafile" value="{{datafile.url|urlencode}}">
		<a class="filelink" href="{{datafile.dataset.experiment.url}}experiment/view/{{mytardis_id}}/download?url={{datafile.url|urlencode}}">{{ datafile.filename }}</a>  ({% if datafile.size %}{{ datafile.size|filesizeformat }} {% endif %}{{ datafile.url }})
	
		{% if datafile.datafileparameter_set.count %}
		<a class="datafile_info_toggle" href="/ajax/parameters/{{ datafile.id}}">[Metadata]</a>
		<ul class="datafile_info">

		</ul>
		{% endif %}
	
		{% if datafile.xml_data_set.count %}
		<a class="datafile_info_toggle" href="/ajax/xml_data/{{ datafile.id }}">[Metadata]</a>
		<ul class="datafile_info" style="width: 95%; overflow:auto; padding: 5px; font-size: 12px">
		</ul>
		{% endif %}
	
	</li>
	{% endfor %}
{% else %}
	{% for datafile in dataset.object_list %}
	<li class="datafile">
		<!-- <input type="checkbox" class="datafile_checkbox" name="datafile" value="{{datafile.id}}"> -->
		<a class="filelink" href="/experiment/view/{{datafile.dataset.experiment.id}}/download?dfid={{datafile.id}}">{{ datafile.filename }}</a> {% if datafile.size %}({{ datafile.size|filesizeformat }}){% endif %}
	
		{% if datafile.datafileparameter_set.count %}
		<a class="datafile_info_toggle" href="/ajax/parameters/{{ datafile.id}}">[Metadata]</a>
		<ul class="datafile_info">

		</ul>
		{% endif %}
	
		{% if datafile.xml_data_set.count %}
		<a class="datafile_info_toggle" href="/ajax/xml_data/{{ datafile.id }}">[Metadata]</a>
		<ul class="datafile_info" style="width: 95%; overflow:auto; padding: 5px; font-size: 12px">
		</ul>
		{% endif %}	
	
	</li>
	{% endfor %}
{% endif %}
<br/>
<div class="pagination">
    <span class="step-links">
        {% if dataset.has_previous %}
            <a class="pagelink" href="/ajax/datafile_list/{{dataset_id}}/?page={{ dataset.previous_page_number }}{% if filename_search %}&filename={{filename_search}}{% endif %}">Previous</a>
        {% endif %}
		
		{% for pagenum in dataset.paginator.page_range %}
				<a class="pagelink" href="/ajax/datafile_list/{{dataset_id}}/?page={{pagenum}}{% if filename_search %}&filename={{filename_search}}{% endif %}">{{pagenum}}</a>
		{% endfor %}

        {% if dataset.has_next %}
            <a class="pagelink" href="/ajax/datafile_list/{{dataset_id}}/?page={{ dataset.next_page_number }}{% if filename_search %}&filename={{filename_search}}{% endif %}">Next</a>
        {% endif %}

		<br/>
        <span class="current">
            Page {{ dataset.number }} of {{ dataset.paginator.num_pages }}.
        </span>
    </span>
</div>